]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
mpris: Prevent DBus race when creating media players
authorBryan Dunsmore <bryan.dunsmore@outlook.com>
Wed, 13 May 2020 05:38:01 +0000 (00:38 -0500)
committerFlorian Müllner <fmuellner@gnome.org>
Wed, 13 May 2020 17:46:24 +0000 (19:46 +0200)
Sometimes an MPRIS media player will create and then destroy an object
before the signals that handle the object's destruction can be created.
This verifies that the object still exists after the necessary signals
have been created.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2776

js/ui/mpris.js

index 9eabe4431f6ecb7a31ef31014baf625e3119ab07..23fca91b18e95648d79c47003bf0ac5be118aeb4 100644 (file)
@@ -173,6 +173,11 @@ var MprisPlayer = class MprisPlayer {
                 if (!this._mprisProxy.g_name_owner)
                     this._close();
             });
+        // It is possible for the bus to disappear before the previous signal
+        // is connected, so we must ensure that the bus still exists at this
+        // point.
+        if (!this._mprisProxy.g_name_owner)
+            this._close();
     }
 
     _onPlayerProxyReady() {